import { StationVO } from '@/api/station/types';
import { VxeGridProps } from 'vxe-table';
import { BizStationEnergySummaryVo } from '@/api/station/energy/types';

export function getTableConfig(): VxeGridProps<BizStationEnergySummaryVo> {
  return {
    id: 'tenant',
    loading: false,
    height: 'auto',
    autoResize: true,
    border: 'inner',

    resizable: true,
    showOverflow: 'tooltip',
    stripe: true,
    rowConfig: {
      isHover: true,
      keyField: 'id'
      // height: 56
    },
    customConfig: {
      storage: true
    },
    columns: [
      { title: '序号', type: 'seq', width: 50 },
      { sortable: true, field: 'stationName', title: '站房名称' },
      { sortable: true, field: 'location', title: '区域' },
      { sortable: true, field: 'ePayType', title: '结算类型', slots: { default: 'epayType' } },
      { sortable: true, field: 'totalUsage', title: '累计用电量' },
      { sortable: true, field: 'totalPaid', title: '累计电费' },
      { sortable: true, field: 'lastSettleTime', title: '上次结算时间' },
      { sortable: true, field: 'unpaid', title: '待结算电量' },
      { sortable: true, field: 'unsettle', title: '待结算费' },
      { sortable: true, field: 'handle', title: '操作', width: '120px', slots: { default: 'handle' } }
    ],
    data: [] as BizStationEnergySummaryVo[]
  };
}
